The present invention relates to an optical sensor circuit. Specifically, the present invention relates to an optical sensor circuit that outputs an analog signal indicating a light quantity accumulated for a certain period of time as a quantity of change from a reference voltage.
A photoelectric converter that converts an optical signal to an electric signal is used for measuring a light quantity or for reading or obtaining an image. A light-quantity-accumulation-type optical sensor circuit, that utilizes a photoelectric converter, has been known, which outputs data of the light quantity accumulated for a certain period of time as analog data indicating an accumulated light quantity as a quantity of change from a reference voltage.
FIG. 12 is a block circuit diagram of a conventional light-quantity-accumulation-type optical sensor circuit. FIG. 13 is a timing chart explaining the operation of the conventional optical sensor circuit of FIG. 12. Referring now to FIG. 12, the conventional optical sensor circuit includes a photodiode 1, that is a photoelectric converter for converting light to an electric signal, a reset switch 2, a capacitor 3 for accumulating electric charges, and an operational amplifier 4. The cathode of the photodiode 1 is connected to a power supply line. The anode of the photodiode 1 is connected to an inverted input terminal of the operational amplifier 4. The reset switch 2 and the capacitor 3 are connected parallel to each other between the inverted input terminal and the output terminal of the operational amplifier 4 such that an integration circuit is formed. A reference voltage Vref is connected to a non-inverted input terminal of the operational amplifier 4. The output of the operational amplifier 4, i.e. output of the light-quantity-accumulation-type optical sensor circuit, is connected to an analog to digital (A/D) converter 5.
Now, the operation of the optical sensor circuit of FIG. 12 will be explained with reference to FIG. 13. The photodiode 1 is outputting a photo-current i corresponding to the quantity of the light that the photodiode 1 has received to the integration circuit. As the reset switch 2 is switched on at a time to, the output terminal and the inverted input terminal of the operational amplifier 4 are short-circuited. Therefore, the potentials of the output and inverted input terminals of the operational amplifier 4 are identical to the reference voltage Vref. The capacitor 3 is discharged and the quantity of the electric charges accumulated in the capacitor 3 reduces to zero. Then, as the reset switch 2 is switched off at a time t1, the photo-current i generated by the photodiode 1 is accumulated in the capacitor 3. As a result, the output voltage Vout lowers with passage of time. If time after time t1 is indicated as t, the output voltage Vout will be expressed by the following equation (1).
Vout=Vrefxe2x88x92(ixc3x97t/c)xe2x80x83xe2x80x83(1)
Here, c is a capacity of the capacitor 3. That is, the output voltage Vout lowers from the reference voltage Vref in proportion to the light quantity. Therefore, by detecting the output voltage Vout after a certain integration time period, the quantity of light irradiated to the photodiode 1 will be measured. In many cases, the output voltage Vout, that is an analog quantity, is inputted to the A/D converter 5 and converted to a digital quantity to facilitate subsequent data processing by a microprocessor.
As FIG. 13 clearly shows, the maximum value of the output voltage Vout of the optical sensor circuit is Vref. Therefore, the output voltage Vout of the optical sensor circuit varies in the range between the Vref and GND (0 volt). It is preferable that this output range is identical to the input range of the A/D converter 5. When the input range of the A/D converter 5 is narrower than the output range of the optical sensor circuit, the analog value that exceeds the input range is not converted to a correct digital value. When the input range of the A/D converter 5 is wider than the output range of the optical sensor circuit, the resolution of the digital quantity lowers. The A/D converter 5 converts the analog value in its input range to a digital value with a predetermined bit number. When the bit number is same, the pitch for quantization becomes wider as the input range is wider, resulting in low resolution. In other words, the input range of the A/D converter 5 that exceeds the output range of the optical sensor circuit does not contribute to A/D conversion, resulting in low resolution. Due to the foregoing reason, it is desirable that the output range of the optical sensor circuit is adjusted to the input range of the A/D converter 5.
The input range of a specific A/D converter is generally between the reference voltage specific to the A/D converter or the CPU in the subsequent stage and the earth potential GND. Since various A/D converters are used depending on the ways of their use considering the costs and performances, the input ranges of various A/D converters are also various. However, the input range of the conventional optical sensor circuit is fixed between its reference voltage Vref and the earth potential GND. Thus, it is difficult to optimally set the input range and the output range of the conventional optical sensor circuit for the various A/D converters.
In view of the foregoing, it is an object of the invention to provide an optical sensor circuit, wherein the output range of the sensor circuit is adjustable to the input range of the A/D converter disposed in the subsequent stage.
According to an aspect of the invention, there is provided an optical sensor circuit that outputs an analog signal indicative of a received light quantity. The optical sensor circuit includes: a light detector element for detecting light and for outputting a photo-current indicating the quantity of the detected light; light quantity accumulating means, to which the photo-current is inputted, for accumulating the quantity of the detected light for a certain period of time and for outputting an analog signal indicating the accumulated quantity of the detected light as a quantity of change from a reference voltage; and output range changing means for changing the output range of the analog signal.
Advantageously, the output range changing means includes a plurality of reference voltage generating means for outputting voltages different from each other, and a reference voltage selecting means for selecting one of the outputs of the reference voltage generating means and for feeding the selected output to the light quantity accumulating means as its reference voltage.
Since the above circuit configuration facilitates selecting appropriate one of the reference voltages as the upper limit of the output range, the output range of the optical sensor circuit can be changed to match the input range in the various A/D converters. Since the output range of the optical sensor circuit is matched with the input range of the A/D converters, erroneous conversion in the A/D converter is avoided. And, since the analog light quantity data is converted to digital data fully utilizing the resolution of the A/D converter, the precision of the subsequent digital data processing is improved.
Advantageously, the output range changing means includes an amplifier connected to the output of the light quantity accumulating means, the amplification factor of which is adjustable at an appropriate value.
Since the above circuit configuration facilitates setting the amplification factor of the amplifier at an arbitrary value, the optical sensor circuit is adaptable to various A/D converters with various input ranges.